// sass-lint:disable no-empty-rulesets
@import "../base";
@import "variables";

@include block(search-box) {
  position: relative;
  max-width: 300px;
  width: 100%;

  @include element(input) {
    /* search input */
    padding-left: 24px;
    height: 100%;
    width: 100%;
  }

  @include element(magnifier) {
    background: transparent;
    position: absolute;
    user-select: none;
    top: 4px;
    left: 7px;

    svg {
      display: block;
      vertical-align: middle;
      height: 14px;
      width: 14px;
    }
  }

  @include element(loading-indicator-wrapper) {
    display: none;
    background: transparent;
    position: absolute;
    user-select: none;
    top: 4px;
    left: 7px;

    svg {
      vertical-align: middle;
      height: 14px;
      width: 14px;
    }
  }

  @include element(reset) {
    background: none;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
    margin: 0;
    border: 0;
    padding: 0;
    user-select: none;

    svg {
      display: block;
      width: 12px;
      height: 12px;
    }
  }

  @include element(powered-by) {
    font-size: .8em;
    text-align: right;
    margin-top: 2px;
  }
  //
  // Image replacement technique used:
  // http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/
  //
  @include element(powered-by-link) {
    display: inline-block;
    width: 45px;
    height: 16px;
    text-indent: 101%;
    overflow: hidden;
    white-space: nowrap;
    background-image: url('data:image/svg+xml;utf8,<svg width="169" height="54" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1366 362"><linearGradient id="a" x1="428.3" x2="434.1" y1="404.1" y2="409.9" gradientTransform="matrix(94.045 0 0 -94.072 -40381.5 38479.5)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="%2300aeff"/><stop offset="1" stop-color="%233369e7"/></linearGradient><path fill="url(%23a)" d="M61.8 15.4h242.8A43.4 43.4 0 0 1 348 58.8v242.9a43.4 43.4 0 0 1-43.4 43.4H61.8a43.4 43.4 0 0 1-43.4-43.4v-243a43.3 43.3 0 0 1 43.4-43.3z"/><path fill="%23fff" d="M187 98.7a93.1 93.1 0 1 0 0 186.3 93.1 93.1 0 0 0 0-186.3zm0 158.8a65.6 65.6 0 1 1 0-131.3 65.6 65.6 0 0 1 0 131.3zm0-117.8v48.9c0 1.4 1.5 2.4 2.8 1.7l43.4-22.5c1-.5 1.3-1.7.8-2.7a54 54 0 0 0-45-27.3c-1 0-2 .8-2 1.9zm-60.8-35.9l-5.7-5.7a14.2 14.2 0 0 0-20.2 0l-6.8 6.8a14.2 14.2 0 0 0 0 20.2l5.6 5.6c.9.9 2.2.7 3-.2a110 110 0 0 1 23.8-23.8c1-.6 1.1-2 .3-2.9zM217.5 89V77.7c0-7.9-6.4-14.3-14.3-14.3h-33.3c-7.9 0-14.3 6.4-14.3 14.3v11.6c0 1.3 1.2 2.2 2.5 1.9a104.2 104.2 0 0 1 57-.3 2 2 0 0 0 2.4-1.9z"/><path fill="%23182359" d="M842.5 267.6c0 26.7-6.8 46.2-20.5 58.6-13.7 12.4-34.6 18.6-62.8 18.6-10.3 0-31.7-2-48.8-5.8l6.3-31c14.3 3 33.2 3.8 43.1 3.8 15.7 0 26.9-3.2 33.6-9.6s10-15.9 10-28.5v-6.4c-3.9 1.9-9 3.8-15.3 5.8a75.7 75.7 0 0 1-21.8 2.9 82 82 0 0 1-29.5-5.1 61.7 61.7 0 0 1-37.7-39.8 144.7 144.7 0 0 1 .3-78.3 72.1 72.1 0 0 1 42.8-43.3 96.3 96.3 0 0 1 35.5-6.7 214 214 0 0 1 35.8 3.5c11.4 1.9 21.1 3.9 29 6.1v155.2zm-108.7-77.2c0 16.4 3.6 34.6 10.8 42.2a36.7 36.7 0 0 0 27.9 11.4 59.5 59.5 0 0 0 31-8.7v-97.1c-2.8-.6-14.5-3-25.8-3.3a39 39 0 0 0-32.6 14.7c-7.5 9.3-11.3 25.6-11.3 40.8zm294.3 0c0 13.2-1.9 23.2-5.8 34.1s-9.4 20.2-16.5 27.9c-7.1 7.7-15.6 13.7-25.6 17.9s-25.4 6.6-33.1 6.6a102 102 0 0 1-32.9-6.6 74.5 74.5 0 0 1-25.5-17.9 92.8 92.8 0 0 1-22.6-62 107 107 0 0 1 5.8-36.7c4-10.8 9.6-20 16.8-27.7s15.8-13.6 25.6-17.8c9.9-4.2 20.8-6.2 32.6-6.2s22.7 2.1 32.7 6.2a71.5 71.5 0 0 1 25.6 17.8 82.5 82.5 0 0 1 16.6 27.7c4.2 10.8 6.3 23.5 6.3 36.7zm-40 .1c0-16.9-3.7-31-10.9-40.8a35.2 35.2 0 0 0-30.2-14.8c-12.9 0-23 4.9-30.2 14.8a69 69 0 0 0-10.7 40.8c0 17.1 3.6 28.6 10.8 38.5a35 35 0 0 0 30.2 14.9c12.9 0 23-5 30.2-14.9a61.4 61.4 0 0 0 10.8-38.5zm127.1 86.4c-64.1.3-64.1-51.8-64.1-60.1L1051 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9zm68.9 0h-39.3V108.1l39.3-6.2v175zm-19.7-193.5a23.7 23.7 0 0 0 0-47.4 23.7 23.7 0 1 0 0 47.4zm117.4 18.6c12.9 0 23.8 1.6 32.6 4.8 8.8 3.2 15.9 7.7 21.1 13.4s8.9 13.5 11.1 21.7a100 100 0 0 1 3.4 27.1v100.6c-6 1.3-15.1 2.8-27.3 4.6s-25.9 2.7-41.1 2.7c-10.1 0-19.4-1-27.7-2.9-8.4-1.9-15.5-5-21.5-9.3a45 45 0 0 1-13.9-16.6c-3.3-6.8-5-16.4-5-26.4 0-9.6 1.9-15.7 5.6-22.3 3.8-6.6 8.9-12 15.3-16.2a65.8 65.8 0 0 1 22.4-9 128.3 128.3 0 0 1 55.4.8v-6.4c0-4.5-.5-8.8-1.6-12.8-1.1-4.1-3-7.6-5.6-10.7-2.7-3.1-6.2-5.5-10.6-7.2s-10-3-16.7-3a142.7 142.7 0 0 0-43.1 6.9l-4.7-32.1a170.2 170.2 0 0 1 51.9-7.7zm3.3 141.9c12 0 20.9-.7 27.1-1.9v-39.8a93.2 93.2 0 0 0-36.1-1.9c-4.4.6-8.4 1.8-11.9 3.5s-6.4 4.1-8.5 7.2a13.6 13.6 0 0 0-3.2 9.6c0 9.2 3.2 14.5 9 18a44.9 44.9 0 0 0 23.6 5.3zM512.9 103c12.9 0 23.8 1.6 32.6 4.8a52.2 52.2 0 0 1 21.1 13.4 52.1 52.1 0 0 1 11.1 21.7 100 100 0 0 1 3.4 27.1v100.6c-6 1.3-15.1 2.8-27.3 4.6a283.4 283.4 0 0 1-41.1 2.7c-10.1 0-19.4-1-27.7-2.9-8.4-1.9-15.5-5-21.5-9.3a45 45 0 0 1-13.9-16.6c-3.3-6.8-5-16.4-5-26.4 0-9.6 1.9-15.7 5.6-22.3 3.8-6.6 8.9-12 15.3-16.2a65.8 65.8 0 0 1 22.4-9 128.3 128.3 0 0 1 55.4.8v-6.4c0-4.5-.5-8.8-1.6-12.8-1.1-4.1-3-7.6-5.6-10.7a26.3 26.3 0 0 0-10.6-7.2c-4.4-1.7-10-3-16.7-3a142.7 142.7 0 0 0-43.1 6.9l-4.7-32.1c4.9-1.7 12.2-3.4 21.6-5.1 9.4-1.8 19.5-2.6 30.3-2.6zm3.4 142c12 0 20.9-.7 27.1-1.9v-39.8a93.2 93.2 0 0 0-36.1-1.9c-4.4.6-8.4 1.8-11.9 3.5s-6.4 4.1-8.5 7.2a13.6 13.6 0 0 0-3.2 9.6c0 9.2 3.2 14.5 9 18s13.7 5.3 23.6 5.3zm158.5 31.9c-64.1.3-64.1-51.8-64.1-60.1L610.6 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    vertical-align: middle;
  }
}

.ais-search-box.ais-stalled-search {
  .ais-search-box--magnifier-wrapper {
    display: none;
  }

  .ais-search-box--loading-indicator-wrapper {
    display: block;
  }
}

